#include <iostream>
using namespace std;

const int kMaxN = 110;

int a[kMaxN];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, tar = 0;

  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    tar += a[i];
  }
  tar /= n;

  int now = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    now += a[i] - tar;
    if (now != 0) {
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}